package com.yun.zf.admin.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yun.zf.common.admin.dto.community.CommunityPictureDto;
import com.yun.zf.common.app.domain.ZfCommunityPicture;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 社区环境图片表 Mapper 接口
 * </p>
 *
 * @author cj
 * @since 2021-01-29
 */
@Mapper
public interface ZfCommunityPictureMapper extends BaseMapper<ZfCommunityPicture> {

    @Select("<script>" +
            " SELECT id pid, url,type from zf_community_picture WHERE community_id=#{communityId} " +
            " <if test=\"type!=-1 \"> and  type = #{type} </if> " +
            "</script>")
    List<CommunityPictureDto> getPictureByCid(Long communityId, int type);
}
